package com.qianli.user.domain.enums;

/**
 * name:芝麻认证状态
 * auth:ting.li@qianli-inc.com
 * date:2018/1/10 21:43
 * version: v1.0.0
 **/
public enum  ZmCreditStatusEnum {

    INIT(-1,"初始化"),
    SUCCESS(1,"成功"),
    FAIL(0,"失败")
    ;
    private Integer type;

    private String desc;

    ZmCreditStatusEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public ZmCreditStatusEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public ZmCreditStatusEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }
    public static ZmCreditStatusEnum getEnumByType(Integer type) {
        ZmCreditStatusEnum zmCreditStatusEnum = null;
        for (ZmCreditStatusEnum enumObj : ZmCreditStatusEnum.values()) {
            if (enumObj.getType().equals(type)) {
                zmCreditStatusEnum = enumObj;
                break;
            }
        }

        return zmCreditStatusEnum;
    }
}
